function fb_code() {
    FB.Event.subscribe('auth.authResponseChange', function(response) {
        if (response.status === 'connected') {
            FB.api('/me', function(response) {
                document.getElementById("logged-in").innerHTML = 
                    "Welkom, " + response.name;
            });
            hideLoginButton();
        } else if (response.status === 'not_authorized') {
            FB.login();
        } else {
            FB.login();
        }
    });
}

function hideLoginButton() {
   document.getElementById("fb-button").style.display = "none";
}
